package com.hongshu.web.service.recommendation.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 用户画像模型
 * 
 * @author hongshu
 * @date 2024/01/01
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UserProfile {
    
    private String userId;
    private Integer age;
    private String gender;
    private String location;
    private int behaviorCount;
    private List<String> likedItems;
    private List<String> followingUsers;
    private List<String> interestTags;
    private Map<String, Double> tagPreferences;
    private boolean isNewUser;
    private boolean isActiveUser;
    
    /**
     * 默认用户画像
     */
    public static UserProfile defaultProfile() {
        return UserProfile.builder()
            .userId("default")
            .age(null)
            .gender(null)
            .location(null)
            .behaviorCount(0)
            .likedItems(new ArrayList<>())
            .followingUsers(new ArrayList<>())
            .interestTags(new ArrayList<>())
            .tagPreferences(new HashMap<>())
            .isNewUser(true)
            .isActiveUser(false)
            .build();
    }
}

